<include file="Public:header" />
<include file="Public:leftside" />
<link rel="stylesheet" type="text/css" href="/NewAdmin/css/app.v1.css"/>
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i>
				<a href="#">首页</a>
			</li>
			<li class="active">添加代言</li>
		</ul>
	</div>
<style>
input,select {
    width: 220px;
    background-color: #fff;
    border: 1px solid #dce4ec;
}
</style>
	<section class="vbox">

		<section class="scrollable wrapper">
			<div class="row padder-v">
				<div class="col-sm-9">
					<a href="{:U('Shop/angel_list')}" class="btn btn-sm btn-default"> 代言管理 </a>
					<a href="{:U('Shop/add_angel')}" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加代言 </a>
				</div>

			</div>
			<!-- 操作提示  start -->
			<section class="panel-default m-b-sm">
				<div class="alert alert-info">
					<p>
						<button type="button" class="close"><i class="fa fa-minus"></i></button>
						<i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
					</p>
					<p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>添加代言</p>
				</div>
			</section>
			
			<!-- 操作提示  end -->

			<section class="panel panel-default">
				<header class="panel-heading font-bold"> 添加代言 </header>
				<div class="panel-body">
				<form action="{:U('Shop/add_angel')}" method="post" class="form form-horizontal" role="form">
		
				
				<div class="form-group">
					<label class="col-sm-2 control-label">注册手机号</label>
					<div class="controls">
						<input type="text" class="form-control" id="res_phone" value="" style="float: left;width: 30%;margin-right: 1%;">
						<input type="button" id="search_res_phone" value="搜索" class="btn btn-sm" style="float: left;background: #eee;height: 35px;">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">用户ID</label>
					<div class="controls">
						<input type="text" id="b_uid" autocomplete="off" value="" readonly="" name="uid" datatype="required" data="用户ID"><span class="form-required">*</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">店铺</label>
					<div class="controls">
						{$storeArray.title}
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-4 col-sm-offset-2" style="padding-left: 0px">
						<button class="btn btn-info formSubmit" id="form" type="button"><i class="icon-ok bigger-110"></i>提交</button>
					</div>
				</div>
				</form>
				</div>
			</section>

		</section>
	</section>

	<script>

        $(function(){

            $('#search_res_phone').click(function(){
                var phone=$('#res_phone').val();
                if(phone){
                    $.get('/shop/search_phone2/phone/'+phone, function(data) {
                        if(data==0){
                            layer.msg('该用户不存在！');

                        }else if(data==1){
                            layer.msg('该用户已成为店铺代言人！');
                        }else{
                            $('#b_uid').val(data.id);
                        }
                    });
                }else{
                    layer.msg('请输入绑定手机号');
                }
            })

        })


	</script>
	<include file="Public:footer" />